App Inventor Animation
HWAI3 (all must do 1-6, advanced 7-9)
- Add a canvas to the app with width of "fill parent" and height 400.
- Add three balls from the Animation folder to the canvas. Ball1 should move from left of screen to right at 100 pixels a second. Code and test this before you go on.
- Ball2 should move top of screen to bottom at 20 pixels a second.
- Ball3 should move diagonally top-left to bottom-right at 50 pixels a second.
- Make it so when ball1 gets to right edge, have it appear on the left side.
- Make it so all balls 2 and 3 reverse their course when they reach an edge, e.g., when hit right side, go left.
- Add "Faster" and "Slower" buttons that change speed of the balls by 10%
- Make it so one of the balls changes color every 20 ms. colors. Hint: You can set the PaintColor of a ball (or anything) using either a built-in color or a number. For instance, dark orange is the number -29696. So try setting the PaintColor of the ball in the Screen.Initialize event, then adding 100 to it every 20 ms. For more info on colors, see http://experimental.appinventor.mit.edu/learn/reference/blocks/colors.html.
- If top-to-bottom ball hits another ball, have it immediately go back to top.
|